home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7689 < prev    next >
Encoding:
Text File  |  1996-08-05  |  862 b   |  23 lines

  1. Path: keats.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: HELP IN WRITING MY FIRST PROGRAM ASSINGMENT
  5. Date: 26 Feb 1996 13:48:54 -0800
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4gt9s6INN8c4@keats.ugrad.cs.ubc.ca>
  8. References: <3127dd4f.19010083@news.planet.net> <4gikk6INNjiv@keats.ugrad.cs.ubc.ca>
  9. NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
  10.  
  11. In article <4gikk6INNjiv@keats.ugrad.cs.ubc.ca>,
  12. I goofed up a little, here is the correction:
  13.  
  14. #include <stdio.h>
  15. #include <stdlib.h>
  16. #include <string.h>
  17. int c(char **x,char**y){return strcmp(*x,*y);}int main(){int i=0,j;char
  18. x[256],*y[100];for(i=0;i<100&&fgets(x,256,stdin);i++)
  19. i[y]=strdup(x);qsort(y,i,sizeof(char*),(int(*)(const void*,const
  20. void*))c); for(j=0;j<i;j++)fputs(j[y],stdout);return 0;}
  21. -- 
  22.  
  23.